import * as types from '../constants/ActionTypes';

const initialState = {
  data: {},
  cVisitRemind: {},
  aVisitRemind: {},
  stage: '',
  visit: {},
  vid: '',
  feedback: {},
  note: {},
  getNote: {},
  moreVoices: {},
};

const MyCustomerDetailReducer = (state = initialState, action) => {
  switch (action.type) {
    case types.MY_CUSTOMER_DETAILS:
      return ({ ...state,
        ...{
          data: action.data,
        } });
    case types.CHANGE_VISIT_REMIND:
      return ({ ...state,
        ...{
          cVisitRemind: action.cVisitRemind,
        } });
    case types.ADD_VISIT_REMIND:
      return ({ ...state,
        ...{
          aVisitRemind: action.aVisitRemind,
        } });
    case types.DELETE_VISIT_REMIND:
      return ({ ...state,
        ...{
          vid: action.vid,
        } });
    case types.USER_STAGE_SELECT:
      return ({ ...state,
        ...{
          stage: action.stage,
        } });
    case types.MORE_VISIT:
      return ({ ...state,
        ...{
          visit: action.visit,
        } });
    case types.FEEDBACK:
      return ({ ...state,
        ...{
          feedback: action.feedback,
        } });
    case types.CHANGE_NOTE:
      return ({ ...state,
        ...{
          note: action.note,
          errMessage: action.errNote,
        } });
    case types.GET_NOTE:
      return ({ ...state,
        ...{
          getNote: action.getNote,
        } });
    case types.VOICES:
      return ({ ...state,
        ...{
          moreVoices: action.moreVoices,
        } });
    default:
      return state;
  }
};

export default MyCustomerDetailReducer;
